/**
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ES2PANDA_PARSER_INCLUDE_TOKEN_TYPE_H
#define ES2PANDA_PARSER_INCLUDE_TOKEN_TYPE_H

namespace ark::es2panda::lexer {

% allTokens = Tokens::tokens + Keywords::keywords

enum class TokenType {
    EOS,

    LITERAL_IDENT,
    LITERAL_STRING,
    LITERAL_CHAR,
    LITERAL_NUMBER,
    LITERAL_REGEXP,
%   allTokens.each do |token|
%     token.flags&.each do |flag|
%       raise "Invalid flag #{flag}" unless Tokens::flags.has_key? flag.to_sym
%     end
    <%= token.token %>,
%   end
    JS_DOC_START,
    JS_DOC_END,
    FIRST_PUNCTUATOR = <%= Tokens::tokens[0].token %>,
    FIRST_KEYW = <%= Keywords::keywords[0].token %>
};

const char *TokenToString(TokenType type);
}  // namespace ark::es2panda::lexer

#endif
